package com.assistant.core.modules.sys.adapter.web.user.model;

import com.assistant.core.modules.sys.domain.user.User;
import com.google.common.collect.Lists;
import lombok.Data;

import java.util.List;

@Data
public class UserInfo {

    private List<String> roles;
    private String name;
    private String avatar;
    private String introduction;

    public static UserInfo createBy(User user) {
        final UserInfo userInfo = new UserInfo();
//        userInfo.roles = user.getRoles();
        userInfo.roles = Lists.newArrayList("admin", "editor");
        userInfo.name = user.getName();
        userInfo.avatar = user.getAvatar();
        userInfo.introduction = user.getIntroduction();
        return userInfo;
    }

}